<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		*{
			padding: 0px;
			margin: 0px;
		}
		li{
			list-style: none;
		}
		.out{
			width: 400px;
			height: 230px;
			margin: 100px auto;
			overflow: hidden;
		}
		.title_list{
			width: 100%;
			height: 30px;
		}
		.title_list .title{
			width: 80px;
			height: 30px;
			background: #F5F5F5 url() 0 0 no-repeat;
			float: left;
			text-align: center;
			line-height: 30px;
			cursor: pointer;
		}
		.content_list{
			width: 2000px;
			height: 200px;
			background: red url() 0 0 no-repeat;
			position: relative;
			left:0px;
		}
		.content_list .content{
			width:400px;
			height: 200px;
			background: #80B600 url() 0 0 no-repeat;
			font-size: 60px;
			text-align: center;
			line-height: 200px;
			color: #fff;
			float: left;
		}
	</style>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script type="text/javascript">
		$(function(){

			$('.title').click(function(){
				$(this).css({'background':'#80B600','color':'#fff'}).siblings().css({'background':'#F5F5F5','color':'#000'});

				left = $(this).index()*-400;

				$('.content_list').animate({left:left},500);

				// $('.content').eq($(this).index()).fadeIn().siblings().fadeOut();
			})
		})
	</script>
</head>
<body>
	<div class="out">
		<ul class="title_list">
			<li class="title" style="background: #80B600;color: #fff">tab1</li>
			<li class="title">tab2</li>
			<li class="title">tab3</li>
			<li class="title">tab4</li>
			<li class="title">tab5</li>
		</ul>
		<ul class="content_list">
			<li class="content" style="display: block">content1</li>
			<li class="content">content2</li>
			<li class="content">content3</li>
			<li class="content">content4</li>
			<li class="content">content5</li>
		</ul>
	</div>
</body>
</html>